#include "vector3.h"

Vector3::Vector3() : x(0.0f), y(0.0f), z(0.0f)
{

}

Vector3::Vector3(float fX, float fY, float fZ) : x(fX), y(fY), z(fZ)
{

}

Vector3::Vector3(Vector3 *vec) : x(vec->x), y(vec->y), z(vec->z)
{

}

float Vector3::operator[](int &param)
{
	if(param == 0) return x;
	else if(param == 1) return y;
	else if(param == 2) return z;
	return 0.0f;
}

Vector3* Vector3::operator+=(Vector3 &param)
{
	x += param.x;
	y += param.y;
	z += param.z;

	return this;
}

Vector3* Vector3::operator+=(float param[3])
{
	x += param[0];
	y += param[1];
	z += param[2];

	return this;
}

Vector3* Vector3::operator-=(Vector3 &param)
{
	x -= param.x;
	y -= param.y;
	z -= param.z;

	return this;
}

Vector3* Vector3::operator-=(float param[3])
{
	x -= param[0];
	y -= param[1];
	z -= param[2];

	return this;
}

void Vector3::Set(float fX, float fY, float fZ)
{
    x = fX;
    y = fY;
    z = fZ;
}
